package com.stwitinc.redmine;

import java.io.File;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import com.stwitinc.redmine.dao.DAO;

public class ServletListener extends com.stwitinc.servlet.ServletListener
{
	@Override
	protected void destroy() {
		DAO.destroy();
	}

	@Override
	protected void init(ServletConfig config) throws ServletException {
		DAO.init();
		try {
			LuceneUtil.buildIndex(new File(config.getServletContext().getRealPath("/lucene")));
		} catch (Exception e) {
			throw new ServletException(e);
		}
	}
}
